package com.ctgu.蓝桥杯真题.B组2017;

import java.io.*;
import java.util.Arrays;

/**
 * @author: Backdiy
 * @data: 2021/4/14 14:30
 * @desc:
 */
public class C承压计算 {
    public static void main(String[] args) throws IOException {
        double[][] num = new double[35][35];
        for (int i = 1; i <= 29; i++) {
            for (int j = 1; j <= i; j++) {
                num[i][j] = IO.nextDouble();
            }
        }
        for (int i = 2; i <= 30; i++) {
            for (int j = 1; j <= i; j++) {
                num[i][j] += num[i - 1][j] * 0.5;
                num[i][j] += num[i - 1][j - 1] * 0.5;
            }
        }
        Arrays.sort(num[30], 1, 31);
        IO.out.println(num[30][1]);
        IO.out.println(num[30][30]);
        String s = String.format("%.0f",num[30][30] * 2086458231 / num[30][1]);
        IO.out.println(s);
        IO.out.flush();
    }

    static class IO {
        static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
        static BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
        static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

        static public int nextInt() throws IOException {
            in.nextToken();
            return (int) in.nval;
        }

        static public String readLine() throws IOException {
            return read.readLine();
        }

        public static double nextDouble() throws IOException {
            in.nextToken();
            return in.nval;
        }
    }
}
